.class public Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;
.super Ljava/lang/Object;
.source "ViewSendGlympse.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/android/glympse/ViewSendGlympse;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "OnClickSend"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend$DlgEnableSharing;,
        Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend$PromptForNicknameCallback;
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/glympse/android/glympse/ViewSendGlympse;


# direct methods
.method public constructor <init>(Lcom/glympse/android/glympse/ViewSendGlympse;)V
    .locals 0
    .parameter

    .prologue
    .line 1326
    iput-object p1, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public PreSend()V
    .locals 3

    .prologue
    .line 1346
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-boolean v0, v0, Lcom/glympse/platform/Config;->m_fShareMyLocation:Z

    if-nez v0, :cond_1

    .line 1348
    const-class v0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend$DlgEnableSharing;

    invoke-virtual {v0}, Ljava/lang/Class;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/glympse/android/glympse/DlgBase;->IsCreated(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 1350
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    new-instance v1, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend$DlgEnableSharing;

    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, p0, v2}, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend$DlgEnableSharing;-><init>(Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;Landroid/content/Context;)V

    invoke-virtual {v0, v1}, Lcom/glympse/android/glympse/Glympse;->QueueDialog(Landroid/app/Dialog;)Z

    .line 1357
    :cond_0
    :goto_0
    return-void

    .line 1355
    :cond_1
    invoke-virtual {p0}, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->Send()V

    goto :goto_0
.end method

.method public Send()V
    .locals 5

    .prologue
    .line 1362
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->PrepareTicket()V

    .line 1364
    const/4 v0, 0x0

    .line 1367
    .local v0, nOriginalRecipients:I
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->IsModify()Z

    move-result v2

    if-eqz v2, :cond_3

    .line 1370
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$19(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/common/Ticket;->m_listRecipients:Lcom/glympse/platform/GVector$Recipients;

    invoke-virtual {v2}, Lcom/glympse/platform/GVector$Recipients;->size()I

    move-result v0

    .line 1373
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oServerPost:Lcom/glympse/platform/common/ServerPost;

    iget-object v3, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$19(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v3

    iget-object v4, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v4}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Lcom/glympse/platform/common/ServerPost;->AddModifyTicket(Lcom/glympse/platform/common/Ticket;Lcom/glympse/platform/common/Ticket;)Z

    .line 1374
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oServerPost:Lcom/glympse/platform/common/ServerPost;

    invoke-virtual {v2}, Lcom/glympse/platform/common/ServerPost;->PostNow()V

    .line 1397
    :goto_0
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/common/Ticket;->m_oDestination:Lcom/glympse/platform/common/Place;

    iget-object v2, v2, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_0

    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/common/Ticket;->m_oDestination:Lcom/glympse/platform/common/Place;

    invoke-virtual {v2}, Lcom/glympse/platform/common/Place;->HasLocation()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 1399
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oPlaceList:Lcom/glympse/platform/common/PlaceList;

    iget-object v3, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v3

    iget-object v3, v3, Lcom/glympse/platform/common/Ticket;->m_oDestination:Lcom/glympse/platform/common/Place;

    invoke-virtual {v2, v3}, Lcom/glympse/platform/common/PlaceList;->Add(Lcom/glympse/platform/common/Place;)V

    .line 1403
    :cond_0
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/common/Ticket;->m_strMessage:Ljava/lang/String;

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 1405
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oMessageList:Lcom/glympse/platform/common/MessageList;

    iget-object v3, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v3

    iget-object v3, v3, Lcom/glympse/platform/common/Ticket;->m_strMessage:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/glympse/platform/common/MessageList;->Add(Ljava/lang/String;)V

    .line 1409
    :cond_1
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->IsFavorite()Z

    move-result v2

    if-eqz v2, :cond_2

    .line 1411
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oFavoriteList:Lcom/glympse/platform/common/FavoriteList;

    iget-object v3, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$22(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/glympse/platform/common/FavoriteList;->MoveToTop(Lcom/glympse/platform/common/Ticket;)V

    .line 1415
    :cond_2
    new-instance v1, Lcom/glympse/android/glympse/DlgSendComplete;

    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->getContext()Landroid/content/Context;

    move-result-object v2

    iget-object v3, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-virtual {v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->IsModify()Z

    move-result v3

    if-eqz v3, :cond_5

    iget-object v3, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$19(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v3

    :goto_1
    invoke-direct {v1, v2, v3, v0}, Lcom/glympse/android/glympse/DlgSendComplete;-><init>(Landroid/content/Context;Lcom/glympse/platform/common/Ticket;I)V

    .line 1418
    .local v1, oDlgSendComplete:Lcom/glympse/android/glympse/DlgSendComplete;
    sget-object v2, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/Glympse;->PopView()Lcom/glympse/android/glympse/Glympse$EViews;

    .line 1419
    sget-object v2, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v2, v1}, Lcom/glympse/android/glympse/Glympse;->QueueDialog(Landroid/app/Dialog;)Z

    .line 1439
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    const/4 v3, 0x1

    invoke-static {v2, v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$4(Lcom/glympse/android/glympse/ViewSendGlympse;Z)V

    .line 1440
    return-void

    .line 1381
    .end local v1           #oDlgSendComplete:Lcom/glympse/android/glympse/DlgSendComplete;
    :cond_3
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$20(Lcom/glympse/android/glympse/ViewSendGlympse;)Z

    move-result v2

    if-eqz v2, :cond_4

    .line 1385
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v2

    iget v2, v2, Lcom/glympse/platform/common/Ticket;->m_nDurationMs:I

    sget v3, Lcom/glympse/platform/common/ConfigBase;->ms_nDefaultDurationMs:I

    if-eq v2, v3, :cond_4

    .line 1387
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v2

    iget v2, v2, Lcom/glympse/platform/common/Ticket;->m_nDurationMs:I

    sput v2, Lcom/glympse/platform/common/ConfigBase;->ms_nDefaultDurationMs:I

    .line 1388
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v2}, Lcom/glympse/platform/Config;->Save()V

    .line 1393
    :cond_4
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oSentTickets:Lcom/glympse/platform/common/SentTicketList;

    iget-object v3, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v3

    iget-object v4, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v4}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$21(Lcom/glympse/android/glympse/ViewSendGlympse;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Lcom/glympse/platform/common/SentTicketList;->GenerateTicket(Lcom/glympse/platform/common/Ticket;Ljava/lang/String;)Z

    goto/16 :goto_0

    .line 1415
    :cond_5
    iget-object v3, p0, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->this$0:Lcom/glympse/android/glympse/ViewSendGlympse;

    invoke-static {v3}, Lcom/glympse/android/glympse/ViewSendGlympse;->access$9(Lcom/glympse/android/glympse/ViewSendGlympse;)Lcom/glympse/platform/common/Ticket;

    move-result-object v3

    goto :goto_1
.end method

.method public onClick(Landroid/view/View;)V
    .locals 3
    .parameter "oView"

    .prologue
    .line 1332
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oUserList:Lcom/glympse/platform/common/UserList;

    invoke-virtual {v0}, Lcom/glympse/platform/common/UserList;->GetSelf()Lcom/glympse/platform/common/User;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/common/User;->m_strDisplayName:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 1334
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    const/4 v1, 0x1

    new-instance v2, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend$PromptForNicknameCallback;

    invoke-direct {v2, p0}, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend$PromptForNicknameCallback;-><init>(Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;)V

    invoke-virtual {v0, v1, v2}, Lcom/glympse/android/glympse/Glympse;->PromptForNickname(ZLcom/glympse/android/glympse/DlgShell$DlgShellListener;)V

    .line 1340
    :goto_0
    return-void

    .line 1338
    :cond_0
    invoke-virtual {p0}, Lcom/glympse/android/glympse/ViewSendGlympse$OnClickSend;->PreSend()V

    goto :goto_0
.end method
